package y_2025.m04.d18.t02;

public abstract class Employee {
    public abstract double earnings();
}


// 按年领取薪水
class YearWorker extends Employee {
    @Override
    public double earnings() {
        return 120000; // 示例：年薪12万
    }
}

// 按月领取薪水
class MonthWorker extends Employee {
    @Override
    public double earnings() {
        return 12 * 8000; // 示例：月薪8千，年收入12个月
    }
}

// 按周领取薪水
class WeekWorker extends Employee {
    @Override
    public double earnings() {
        return 52 * 2000; // 示例：周薪2千，年收入52周
    }
}

